package com.zl.gmadmin.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

@TableName(value = "sys_user")
@ApiModel(value = "用户信息表")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class SysUser {

  @TableId(type = IdType.AUTO)
  private Long userId;
  private Long deptId;
  private String username;
  private String nickName;
  private String gender;
  private String phone;
  @TableField(value = "email")
  private String email;
  private String avatarName;
  private String avatarPath;
  private String password;
  private Boolean isAdmin;
  private Integer enabled;
  private String createBy;
  private String updateBy;
  @TableField(fill = FieldFill.UPDATE)
  private LocalDateTime pwdResetTime;
  @TableField(fill = FieldFill.INSERT)
  private LocalDateTime createTime;
  @TableField(fill = FieldFill.UPDATE)
  private LocalDateTime updateTime;

  @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
  @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  private LocalDateTime birthday;

  @TableField(exist = false)
  private List<SysRole> roles;

  @TableField(exist = false)
  private SysDept dept;

  @TableField(exist = false)
  private List<SysJob> jobs;

  public Long getUserId() {
    return userId;
  }

  public void setUserId(Long userId) {
    this.userId = userId;
  }


  public Long getDeptId() {
    return deptId;
  }

  public void setDeptId(Long deptId) {
    this.deptId = deptId;
  }


  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }


  public String getNickName() {
    return nickName;
  }

  public void setNickName(String nickName) {
    this.nickName = nickName;
  }


  public String getGender() {
    return gender;
  }

  public void setGender(String gender) {
    this.gender = gender;
  }


  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }


  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }


  public String getAvatarName() {
    return avatarName;
  }

  public void setAvatarName(String avatarName) {
    this.avatarName = avatarName;
  }


  public String getAvatarPath() {
    return avatarPath;
  }

  public void setAvatarPath(String avatarPath) {
    this.avatarPath = avatarPath;
  }


  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }


  public Boolean getIsAdmin() {
    return isAdmin;
  }

  public void setIsAdmin(Boolean isAdmin) {
    this.isAdmin = isAdmin;
  }


  public Integer getEnabled() {
    return enabled;
  }

  public void setEnabled(Integer enabled) {
    this.enabled = enabled;
  }


  public String getCreateBy() {
    return createBy;
  }

  public void setCreateBy(String createBy) {
    this.createBy = createBy;
  }


  public String getUpdateBy() {
    return updateBy;
  }

  public void setUpdateBy(String updateBy) {
    this.updateBy = updateBy;
  }


  public LocalDateTime getPwdResetTime() {

   return  pwdResetTime;
  }

  public void setPwdResetTime(LocalDateTime pwdResetTime) {
    this.pwdResetTime = pwdResetTime;
  }


  public LocalDateTime getCreateTime() {
    return createTime;
  }

  public void setCreateTime(LocalDateTime createTime) {
    this.createTime = createTime;
  }


  public LocalDateTime getUpdateTime() {
    return updateTime;
  }

  public void setUpdateTime(LocalDateTime updateTime) {
    this.updateTime = updateTime;
  }

  public List<SysRole> getRoles() {
    return roles;
  }

  public void setRoles(List<SysRole> roles) {
    this.roles = roles;
  }

  public SysDept getDept() {
    return dept;
  }

  public void setDept(SysDept dept) {
    this.dept = dept;
  }

  public List<SysJob> getJobs() {
    return jobs;
  }

  public void setJobs(List<SysJob> jobs) {
    this.jobs = jobs;
  }

  public LocalDateTime getBirthday() {
    return birthday;
  }

  public void setBirthday(LocalDateTime birthday) {
    this.birthday = birthday;
  }


  public SysUser(){

  }
}
